Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Server or client-side clock/date display

  1. #11
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Also beware if its a linux server then the getdate command add some rubbish to the end, still not fixed as far as i know

    To remove seconds, you strings.scr and figure it out from there lol

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  2. #12

    Default

    Okay! Great thanks to you all! as always.

    I tried to combine them into the one huddraw string. Is it possible to call both, so that they sit on the same line, and if so whats the operator I need to use? Is it a "+" ":" etc? Tried them, and didn't work. As below

    main:
    while(1)
    {
    local.time = gettime(0) + "AEDT"
    local.date = getdate(0)
    huddraw_align 15 right top
    huddraw_rect 15 -125 75 0 0
    huddraw_font 15 "facfont-20"
    huddraw_alpha 15 1
    huddraw_color 15 1 1 1
    huddraw_string 15 local.date + local.time ??
    wait 1
    }
    end

    Cheers

  3. #13
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    hmmm ,,,,,,,,,,

    hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm,,,,

    this won't work , here is the right way :
    main:
    	local.date = getdate(0)
    	while(1)
    	{
    		local.time = gettime(0)
    		local.time = waitexec global/strings.scr::Left local.time.size-3 local.time
    		huddraw_align  15 right top
    		huddraw_rect   15 -125 75 0 0
    		huddraw_font   15 "facfont-20"
    		huddraw_alpha  15 1
    		huddraw_color  15 1 1 1
    		huddraw_string 15 (local.time + " : " + local.date)
    		wait 59 //that is what i call tricky
    	}
    end


    didn't test.

    oh ,btw , get ur self a modder

  4. #14
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Few things to note aswell

    - gettime gets the local time from the server, so you dnt need to adjust for timezones, as long as the server time is correct.
    - Depending on the OS of the server Linux or Windows, you are best off combining the string first into the one variable before displaying it using huddraw, linux servers dnt like it when you try to parse a const.string through it.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #15

    Default

    Thank you ladz! And indeed Ryback, I should. I am mere mortal amongst gods!

    I couldn't load that above awesome code properly, btw. Server didn't like it and gave below error (strings.scr is up-to-date).

    I will try and load the date/clock scripts separately as a fix.

    Thanks again.

    Code:
    local.time = waitexec global/strings.scr::Left local.time.size-3 local.time  (custom/clock/clock.scr, 6)
    		local.time = waitexec global/strings.scr::Left local.time.size-3 ^
    
    ^~^~^ Script file compile error:  Couldn't parse 'custom/clock/clock.scr'
            exec custom/clock/clock.scr (global/dmprecache.scr, 212)
            ^
    
    ^~^~^ Script Error: Script 'custom/clock/clock.scr' was not properly loaded
    
    
            exec custom/clock/clock.scr (global/dmprecache.scr, 212)
            ^
    
    ^~^~^ Script Error: Script 'custom/clock/clock.scr' was not properly loaded

  6. #16
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Make sure you have global/strings.scr
    and its non capital Left,
    waitexec global/strings.scr::left local.time.size-3 local.time

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  7. #17
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    nah , it is ! check reborn 8 pk3

  8. #18
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    you sure you looking at latest version ??

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  9. #19
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    of reborn or strings ?

  10. #20
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    strings :P
    version i use is dated 20/10/2011

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •